<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看密码</title>
</head>
<body>
    <form id="myForm">
        <table border="1px">
            <tr>
                <td>邮箱</td>
                <td>
                    <input type="text" name="email" placeholder="请输入邮箱">
                </td>
            </tr>
            <tr>
                <td>手机号</td>
                <td>
                    <input type="text" name="phone" placeholder="请输入手机号">
                </td>
            </tr>
            <tr>
                <td>新密码</td>
                <td>
                    <input type="password" name="password" placeholder="请输入密码">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" value="修改" onclick="updateUser()">
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
<script type="text/javascript" src="../js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="../js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="../js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script>
    function updateUser(){
        $.ajax({
            url:"/userController/getPassWord",
            type:"post",
            data:$("#myForm").serialize(),
            dataType:"json",
            success:function (result){
                if(result.code == 100){
                    alert(result.data);
                    location.href="/userController/toLogin"
                }
                if(result.code == 101){
                    alert(result.data);
                }
            },
            error:function (){
                alert("异常");
            }
        })
    }
</script>